﻿using System;
using System.Collections.Generic;
using GISServer.Core.Client.Geometry;
using Newtonsoft.Json;

namespace GISServer.Core.Client
{
    public class FeatureSet
    {
        public FeatureSet()
        {
            Fields = new List<Field>();
            Features = new List<Feature>();
        }

        [JsonProperty("displayFieldName")]
        public String DisplayFieldName { get; set; }

        [JsonProperty("objectIdFieldName")]
        public string ObjectIdFieldName { get; set; }

        [JsonProperty("fields")]
        public List<Field> Fields { get; set; }

        [JsonProperty("geometryType")]
        public string GeometryType { get; set; }

        [JsonProperty("spatialReference")]
        public SpatialReference SpatialReference { get; set; }

        [JsonProperty("features")]
        public List<Feature> Features { get; set; }

        [JsonProperty("fieldAliases")]
        public Attributes FieldAliases { get; set; }

        public string ToJson()
        {
            return Utilities.Serializer.ToJsonWithoutFormatting(this);
        }

    }
}
